#pragma once
#include "circle_container.h"

namespace congruent_packing
{

circle_container_t::circle_container_t()
: R(1.0)
{}

void circle_container_t::clamp_point( PointF & v )
{
	double dot = v.x * v.x + v.y * v.y;

	if( dot >= R * R )
	{
		double inv_len = 1.0 / sqrt(dot);

		v.x *= inv_len;
		v.y *= inv_len;
	}
}

}